package com.avengers.core.handler;


import com.avengers.job.JobNoKit;
import com.jfinal.handler.Handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author yu.wang
 * @since 2019-12-06 15:37
 **/
public class JobNoHandler extends Handler {
    private static final String jobNoPrefix = "web_";

    @Override
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
        JobNoKit.create(jobNoPrefix);
        try {
            next.handle(target, request, response, isHandled);
        } finally {
            JobNoKit.clear();
        }
    }
}
